<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const p1 = new Promise((rsolve,reject) =>{
            try{
                console.log("开始请求A...")
                throw new Error("网络出现问题！！！")
                setTimeout(() => {
                    console.log("数据请求成功");
                    resolve({
                        token:"hskahdoqwhdlkash"
                    })
                }, 3000);
            }
            catch(e){
                reject(e.message)
            }
        })

        /*
        then的返回值补充：
            无论是成功的promise实例还是失败的promise实例调用then，then的返回值规则保持不变

        */ 
        const p2 = p1.then((value) =>{},() =>{
            return new Promise ((resolve,rejrct) =>{
                // resolve("okkk")
                // reject("errr")
            })
        });

        console.log("p2",p2);
    </script>
</body>
</html>